

#include <iostream>
#include <cstring>
#include "CJob.h"


using namespace std;

CJob::CJob()
:m_pWorkThread(NULL)
,m_JobNo(0)
,m_JobName(NULL)
{
}

CJob::~CJob()
{
  if(m_JobName != NULL)
    free(m_JobName);
}


void CJob::SetJobName(char* jobname)
{
  if(m_JobName != NULL)
  {
    free(m_JobName);
    m_JobName = NULL;
  }
  
  if(jobname != NULL)
  {
    m_JobName = (char *)malloc(strlen(jobname) + 1);
    strcpy(m_JobName, jobname);
  }
} 

// void CJob::SetWorkThread(CThread *pWorkThread)
// {
//   m_pWorkThread = pWorkThread;
// }